package cc.chinagps.gateway.common;

public class Constant {
    public static final String DEFAULT_CHARSET = "ascii";
    public static final String CHARSET_GBK = "GBK";
    public static final String SESSION_KEY_SERVER_FLAG_SN ="server_flag_sn_";
    public static final String SESSION_KEY_SN ="sn_";

    public interface CommonAckCode {
        byte LOGIN_SUCCESS = 0x01;
        byte LOGIN_FAILED = 0x02;
    }

    public enum CommandResultCode {
        RESULT_SUCCESS(0, "success"),
        RESULT_FAIL_OTHERS(-1, "unkown reason"),
        RESULT_OPERATOR_ACK_ERROR(6, "device ack error"),
        RESULT_OPERATOR_OFFLINE(10, "device offline"),
        RESULT_NO_COMMAND_ENCODER(11, "no command encoder"),
        RESULT_SEND_DATA_FAIL(17, "send data failed"),
        RESULT_WRONG_FORMAT(16, "wrong format"),
        RESULT_TIMEOUT(18, "command time out"),
        RESULT_TAKE_PHOTO_ERROR(20, "take photo error");

        int code;
        String msg;

        CommandResultCode(int code, String msg) {
            this.code = code;
            this.msg = msg;
        }

        public int code() {
            return code;
        }

        public String msg() {
            return msg;
        }
    }

}
